#include <my_header.h>
/*Usage: ./02_read_write filename */
int main(int argc, char *argv[]){
    ARGS_CHECK(argc,2);
    int fd = open(argv[1],O_RDWR);
    ERROR_CHECK(fd, -1,"open");
    // 直接读取字符二进制，方便进行检查和转换
    char ch;
    ssize_t read_count;
    while((read_count = read(fd, &ch, 1)) > 0){

        lseek(fd, -1, SEEK_CUR);
        ch = toupper(ch);
        write(fd, &ch,1);
    }

    close(fd);
    return 0;
}


